package day3.demo3_线程中断;

public class Test {
    public static void interupt(String[] args)throws Exception {
        A a = new A();
        Thread t = new Thread(a);
        System.out.println("线程准备开始");
        t.start();
        System.out.println("线程已经开始");
        Thread.sleep(100);
        t.interrupt();
        System.out.println("main中线程中断已发出。。。");
    }

    public static void main(String[] args) {
        new Thread(new A()).start();
        new Thread(new B()).start();
    }
}
